package com.banmoon.template;

public abstract class HospitalTemplate {

    /**
     * 模板方法
     */
    public final void goHospital(){
        registration();
        seeADoctor();
        if(getOrder()>5){
            payMoney();
            operation();
            recovery();
        }
        leaveHospital();
    }

    public void registration(){
        System.out.println("挂号成功，等待就诊中~");
    }

    public void seeADoctor(){
        System.out.println("正在就诊中~");
    }

    public abstract int getOrder();

    public void payMoney(){
    }

    public void operation(){
    }

    public void recovery(){
        System.out.println("康复了，好开心~");
    }

    public void leaveHospital(){
        System.out.println("终于离开这该死的医院了~");
    }

}
